import request from '@/utils/request'

export function pageRole(data) {
  return request({
    url: '/role/page',
    method: 'post',
    data
  })
}
export function getRole(id) {
  return request({
    url: `/role/get/${id}`,
    method: 'get',
  })
}
export function deleteRole(id) {
  return request({
    url: `/role/delete/${id}`,
    method: 'delete',
  })
}
export function saveRole(data) {
  return request({
    url: '/role/save',
    method: 'put',
    data
  })
}
export function editRole(data) {
  return request({
    url: '/role/edit',
    method: 'post',
    data
  })
}

export function getRoles() {
  return request({
    url: '/role/getRoles',
    method: 'get',
  })
}

export function getRoleList(userId) {
  return request({
    url: `/user/getRoleList/${userId}`,
    method: 'get',
  })
}
export function bindRoleRel(data) {
  return request({
    url: `/user/bindRoleRel`,
    method: 'post',
    data
  })
}
